package com.hrsaas.ext.spider.err;

/**
 * Exception passed to onError when a redirect loop is encountered, or
 * the redirect URL cannot be parsed.
 *
 * @since 1.7.0
 * @author Tim Boudreau
 */
public class RedirectException extends Exception {

    private final Kind kind;

    public enum Kind {
        REDIRECT_LOOP,
        INVALID_REDIRECT_URL
    }
    
    public RedirectException(Kind kind, String url) {
        super(url);
        this.kind = kind;
    }
    
    public Kind kind() {
        return kind;
    }
}
